<?php

namespace common\model;

use think\model\RelationModel;

class TenantProdCapacityModel extends RelationModel
{
    //自动验证
    protected $_validate = [
        ['tenant_id', '', '', self::MUST_VALIDATE, 'require', self::MODEL_INSERT], //必须字段
        ['tenant_id', '', '', self::MUST_VALIDATE, 'integer', self::MODEL_INSERT], //必须字段
        ['type', '', '', self::MUST_VALIDATE, 'require', self::MODEL_INSERT], //必须字段
        ['type', ['inside', 'outside'], '', self::EXISTS_VALIDATE, 'in'],
        ['user_id', '', '', self::MUST_VALIDATE, 'require', self::MODEL_INSERT], //必须字段
        ['user_id', '', '', self::MUST_VALIDATE, 'integer', self::MODEL_INSERT], //必须字段
        ['level_category', ['s', 'a', 'b', 'c'], '', self::EXISTS_VALIDATE, 'in'],
        ['capacity', '1,24', '', self::EXISTS_VALIDATE, 'between']
    ];

    // 自动完成
    protected $_auto = [

    ];
}
